|
![](/i/fill.gif) |
>> I'm guessing the real cat program also has assorted command-line
>> switches as well though?
>
> OK, so let's ask the manpage:
>
> http://unixhelp.ed.ac.uk/CGI/man-cgi?cat
Apparently POSIX only specifies the -u option; the rest is extensions.
(Common ones though, apparently.) This is apparantly typical for all
widely-known Unix commands. I guess we can thank 40,000,000 years of
backwards compatibility for that.
> I'll see if I can't produce a full implementation...
The attached program appears to do the job. There are probably still
some bugs in it though.
[I definitely can't guarantee it works the same as GNU cat, because I
don't have anything to test against. It's probably broken in it's
handling of "\n" and/or "\r", the line numbering, the text/binary
distinction, and a few other things.]
Post a reply to this message
Attachments:
Download 'us-ascii' (5 KB)
|
![](/i/fill.gif) |